package pri.zey.custom.tools;

import android.app.ProgressDialog;

/**
 * >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>类描述
 * >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>属性描述
 * >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>方法描述
 */
public class TdialogModle {

    /**
     * 标题
     */
    private Object Title;

    /**
     * 文本信息
     */
    private String Msg;

    /**
     * 对话框类型
     */
    private int ProgressStyle = ProgressDialog.STYLE_SPINNER;

    /**
     * 是否点击对话框以外的区域关闭对话框
     */
    private boolean CanceledOnTouchOutside;

    public Object getTitle() {
        if(!Tkit.notNull(Title))
            Title = "";
        return Title;
    }

    public void setTitle(Object title) {
        Title = title;
    }

    public String getMsg() {
        if(!Tkit.notNull(Msg))
            Msg = "";
        return Msg;
    }

    public void setMsg(String msg) {
        Msg = msg;
    }

    public int getProgressStyle() {
        if(!Tkit.notNull(ProgressStyle))
            ProgressStyle = ProgressDialog.STYLE_SPINNER;
        return ProgressStyle;
    }

    public void setProgressStyle(int progressStyle) {
        ProgressStyle = progressStyle % 2;
        if (ProgressStyle == 0)
            ProgressStyle = ProgressDialog.STYLE_SPINNER;
    }

    public boolean isCanceledOnTouchOutside() {
        if(!Tkit.notNull(CanceledOnTouchOutside))
            CanceledOnTouchOutside = false;
        return CanceledOnTouchOutside;
    }

    public void setCanceledOnTouchOutside(boolean canceledOnTouchOutside) {
        CanceledOnTouchOutside = canceledOnTouchOutside;
    }
}
